SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author:		@in_Author,,Name>
-- Create date: @in_Create Date,
-- Description:	@in_Description,
-- =============================================
CREATE PROCEDURE [dbo].[usp_Mst_Products_Update]
(
 @in_CategoryId int
,@in_ProductCode varchar(50)
,@in_ProductName varchar(50)
,@in_ProductDesc varchar(250)
,@in_PetaluId int
,@in_Quantity int
,@in_GrossWeight decimal(18,3)
,@in_Wastage decimal(18,3)
,@in_NetWeight decimal(18,3)
,@in_Size decimal(18,2)
,@in_SizeUnitId int
,@in_MakingCharge decimal(18,3)
,@in_StonesDesc varchar(250)
,@in_StonesCount int
,@in_StonesWeight decimal(18,3)
,@in_StonesUnitId int
,@in_TotalStonesCost decimal(18,3)
,@in_StatusId int
,@in_OtherCharges decimal(18, 3)
,@out_ResultCount int out
,@out_ErrorMsg varchar(250) out
,@in_ProductId bigint
)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
BEGIN TRY	
		
		
UPDATE  [Mst_Products]
           SET [CategoryId]=@in_CategoryId
           ,[ProductCode]=@in_ProductCode
           ,[ProductName]=@in_ProductName
           ,[ProductDesc]=@in_ProductDesc
           ,[PetaluId]=@in_PetaluId
           ,[Quantity]=@in_Quantity
           ,[GrossWeight]=@in_GrossWeight
           ,[Wastage]=@in_Wastage
           ,[NetWeight]=@in_NetWeight
           ,[Size]=@in_Size
           ,[SizeUnitId]=@in_SizeUnitId
           ,[MakingCharge]=@in_MakingCharge
           ,[OtherCharges]=@in_OtherCharges
           ,[StonesDesc]=@in_StonesDesc
           ,[StonesCount]=@in_StonesCount
           ,[StonesWeight]=@in_StonesWeight
           ,[StonesUnitId]=@in_StonesUnitId
           ,[TotalStonesCost]=@in_TotalStonesCost
           ,[StatusId]=@in_StatusId
    WHERE [ProductId]=@in_ProductId
    
    SET @out_ResultCount=@@ROWCOUNT
               
       END TRY
BEGIN CATCH   
       SET @out_ErrorMsg= ERROR_MESSAGE()
       SET @out_ResultCount=-1 
  END CATCH
END

GO
